# -*- coding:utf-8 -*-
# __auther__='jiangkai'
# 此类为路由解析器
# 1、changeGotoInfoMessage解析登记信息
# 2、changeGotoWTType解析评估类型

import os

from extScript.Excel import RdExcel


class BDCType:
    def __init__(self,dbctype=None):
        self.dbctype = dbctype
        self.rde = RdExcel(os.getcwd() + "\\inputdata\\" + "不动产信息登记.xlsx")
        self.wtrde = RdExcel(os.getcwd() + "\\inputdata\\" + "委托类型表.xlsx")

    def changeGotoInfoMessage(self,driver,type=None,caseNO=None):
        if type == "国有建设用地使用权":
            from BdcInfo.GYJSYD import GYJSYD
            GYJSYD().test_gyjsd(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "房产":
            from BdcInfo.FC import FC
            FC().fc(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "土地承包经营权":
            from BdcInfo.TDCB import TDCB
            TDCB().tdcb(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "宅基地使用权":
            from BdcInfo.ZJD import ZJD
            ZJD().zjd(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "林权":
            from BdcInfo.LQ import LQ
            LQ().lq(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "草地使用权":
            from BdcInfo.CDSY import CDSY
            CDSY().cdsy(driver,self.rde.getTypeCaseFromTypeNO(type,caseNO))
        elif type == "海域使用权":
            from BdcInfo.HY import HY
            HY().test_hy(driver, self.rde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "水域摊涂养殖权":
            from BdcInfo.SYTT import SYTT
            SYTT().test_sytt(driver, self.rde.getTypeCaseFromTypeNO(type, caseNO))
        else:#type == "矿业权":
            from BdcInfo.KY import KY
            KY().test_ky(driver, self.rde.getTypeCaseFromTypeNO(type, caseNO))

    def changeGotoWTType(self,driver,type=None,caseNO=None):
        #print(type,caseNO,self.wtrde.getTypeCaseFromTypeNO(type,caseNO))
        if type == "交易":
            from BdcType.jy import jy
            jy().test_jy(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "登记":
            from BdcType.dj import dj
            dj().test_dj(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "测绘":
            from BdcType.ch import ch
            ch().test_ch(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "咨询":
            from BdcType.zx import zx
            zx().test_zx(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "评估":
            from BdcType.pg import pg
            pg().test_pg(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))
        elif type == "金融":
            from BdcType.jr import jr
            jr().test_jr(driver, self.wtrde.getTypeCaseFromTypeNO(type, caseNO))

if __name__ == '__main__':
    pass
    #dbct = BDCType()
    #dbct.changeGotoFunc("国有建设用地使用权","typeno3")